<template>
  <el-drawer
    :title="title"
    v-model="showDrawer"
    :direction="direction"
    :size="size"
    :before-close="handleClose" destroy-on-close>
    <div class="drawer-content">
      <slot name="body">
        <div class="notData">暂无数据</div>
      </slot>
    </div>
    <div class="drawer-footer">
      <slot name='footer'></slot>
    </div>
  </el-drawer>
</template>

<script lang="ts">
import { defineComponent, ref, PropType } from '@vue/runtime-core';
export interface BtnData {
	name: string,
	func: Function,
  type: number
}
export default defineComponent({
  props: {
    title: {
      type: String,
      default: '默认标题'
    },
    showDrawer: {
      type: Boolean,
      default: false
    },
    size: {
      type: String,
      default: '45%'
    },
  },
  emits:['handleClose','save'],
  setup(props, ctx) {
    let showDrawer = ref(false)
    const direction = ref('rtl');
    const handleClose = () => {
        ctx.emit('handleClose', false)
      }
    return {
      direction,
      handleClose,
      showDrawer,
    }
  }
})
</script>

<style scoped lang="scss">



.drawer-footer {
  text-align: right;
  padding: 15px 30px;
  box-shadow: 1px 1px 3px 0 $a5-Color;
}


.drawer-content {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
  overflow: auto;
    .notData {
    text-align: center;
    color: #ccc;
    height: 100%;
    border: 0;
  }
}
</style>